//
//  iPhoneType.m
//  听说弱点强化训练
//
//  Created by 盛超 on 2018/11/14.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import "IPhoneType.h"
#import <sys/utsname.h>

@implementation IPhoneType

+ (BOOL)judge_iPhoneX {
    
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString*phoneType = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding];
    
    if([phoneType  isEqualToString:@"iPhone10,3"])  {
        NSLog(@"iPhone X");
        return YES;
    }
    
    
    if([phoneType  isEqualToString:@"iPhone10,6"])   {
        NSLog(@"iPhone X");
        return YES;
    }
    
    if([phoneType  isEqualToString:@"iPhone11,8"]) {
        NSLog(@"iPhone XR");
        return YES;
    }
    
    if([phoneType  isEqualToString:@"iPhone11,2"]) {
        NSLog(@"iPhone XS");
        return YES;
    }
    
    if([phoneType  isEqualToString:@"iPhone11,4"]) {
        
        NSLog(@"iPhone XS Max");
        return YES;
    }
    
    if([phoneType  isEqualToString:@"iPhone11,6"]) {
        
        NSLog(@"iPhone XS Max");
        return YES;
    }
    
    return NO;
}


@end
